/**
 * @description 用户模块相关的 store
 */

import { defineStore } from 'pinia'
import { getUserInfoBS } from '@/api/login'
import type { getUserInfoType } from '@/api/loginType'

export default defineStore('userStore', {
    state: () => ({ userInfo: {} }),
    getters: {},
    actions: {
        async updateUserInfo(params: getUserInfoType) {
            try {
                const { data } = await getUserInfoBS(params)
                this.userInfo = data
            } catch (error) {
                console.log(error)
            }
        }
    }
})